//
//  IMImageCell.m
//  ChatMainDemo
//
//  Created by peiw on 16/1/21.
//  Copyright © 2016年 peiw. All rights reserved.
//

#import "IMImageCell.h"
#import "IMChatDefines.h"

@implementation IMImageCell

- (void)setContent:(IMCellDisplayData *)cellDisplay {
    [super setContent:cellDisplay];
    CGSize size = [self sizeForContent:cellDisplay];
    if (cellDisplay.direction == Send) {
        self.contentImageView.frame = CGRectMake(CGRectGetMinX(self.bubbleView.frame) + IMBubbleContentGap,CGRectGetMinY(self.bubbleView.frame) ,size.width , size.height);
    }else {
        self.contentImageView.frame = CGRectMake(CGRectGetMinX(self.bubbleView.frame)+IMAvatarEdge,CGRectGetMinY(self.bubbleView.frame) ,size.width - IMAvatarEdge , size.height);
    }
}

- (CGSize)sizeForContent:(IMCellDisplayData *)content {
    return content.contentSize;
}

- (CGFloat)cellHeightForMessage:(IMCellDisplayData *)cellDisplay {
    return 0;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
